package com.chinanet.utils.telnet;

public class U31Telnet extends ITelnet{
    public U31Telnet(String ip, int port, String username, String password) {
        super(ip, port, username, password);
    }

    @Override
    public void login(String prompt) {
        this.prompt = prompt;
        readUntilByGET("用户名:");
        write(username);
        readUntilByGET("密码:");
        write(password);
        readUntilByGET(this.prompt + "");
    }
    @Override
    public String sendCommand(String command) {
        try {
            write(command);
            return readUntilByGET(prompt + "");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}